// 文件上传
import ApiResponse from "@/api/common/api-response.ts";
import request from "@/request";
import {UploadRes} from "@/api/common/upload";

export default class CommonApi {

    static async uploadFile(data: FormData): Promise<ApiResponse<UploadRes>> {
        const config = {
            headers: {
                "Content-Type": "multipart/form-data",
            },
        };
        return ApiResponse.fromResponse(await request.post("/upload/file", data, config));
    }
}
